package com.zr.d_c.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.d_c.service.OrderService;
import com.zr.d_c.serviceimpl.OrderServiceImpl;
/**
 * 顾客删除历史订单
 * @author Administrator
 *
 */
public class DeleteHistoryOrderController extends HttpServlet {

	OrderService orderservice = new OrderServiceImpl();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		PrintWriter pw = resp.getWriter();
		String oidstr = req.getParameter("oids");
		String[] oidst = oidstr.split(",");
		int[] oids = new int[oidst.length];
		for (int i = 0; i < oidst.length; i++) {
			oids[i] = Integer.parseInt(oidst[i]);
		}
		if(orderservice.modifyOisdeleteByOid(oids)>0){
			pw.write("1");
		}else{
			pw.write("0");
		}
		pw.close();
	}
}
